package net.es.weathermap.viz;

import java.awt.BasicStroke;
import java.awt.Stroke;

import org.apache.commons.collections15.Transformer;


import net.es.weathermap.beans.Connection;

public class CapacityEdgeStrokeTransformer implements Transformer<Connection, Stroke> {
    public Stroke transform(Connection c) {
        Stroke edgeStroke;
        if (c.getCapacity() < 1000) {
            edgeStroke  = new BasicStroke(0.5f);
        } else if (c.getCapacity() < 10000) {
            edgeStroke  = new BasicStroke(1.0f);
        } else if (c.getCapacity() < 40000) {
            edgeStroke  = new BasicStroke(2.0f);
        } else {
            edgeStroke  = new BasicStroke(2.0f);
        }

        return edgeStroke;
     }

}
